<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">
    <ui:define name="head">
        <script type="text/javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.id != 'editForm:btnCheck') {
                        event.keyCode = 9;
                    }
                }
            }
            function rtnScript(rtnflag, exmsg) {
                if (rtnflag == "true") {
                    window.returnValue = "1";
                    window.close();
                } else {
                    alert(exmsg);
                }
            }
        </script>
        <base target="_self"/>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px;">
            <h:form id="editForm">
                <h:outputText id="rntFlag" escape="false" value="#{validateAction.rtnmsg}"/>
                <p:focus for="usercode"/>
                <p:panel>
                    <h:panelGrid width="100%" cellspacing="0" cellpadding="2" border="0" columns="3">
                        <h:outputLabel value="授权用户:"/>
                        <h:inputText id="usercode" autocomplete="off" required="true"
                                     requiredMessage="请输入用户号" value="#{validateAction.struser}"
                                     style="width:120px"/>
                        <h:message for="usercode" style="color:red;"/>
                        <h:outputLabel value="密码:"/>
                        <h:inputSecret id="password" autocomplete="off" required="true"
                                       requiredMessage="请输入密码" value="#{validateAction.strpwd}"
                                       style="width:120px"/>
                        <h:message for="password" style="color:red;"/>
                    </h:panelGrid>
                </p:panel>
                <p:panel>
                    <h:panelGrid width="100%" cellspacing="0" border="0" columns="1" style="text-align: center;">
                        <h:panelGroup>
                            <h:commandButton id="btnCheck" action="#{validateAction.onBtnCheckClick}"
                                             value="确定" style="width:80px;"></h:commandButton>
                            <p:spacer width="10px"/>
                            <h:commandButton id="btnCancel" immediate="true" onclick="window.close();return false;"
                                             value="取消" style="width:80px;"></h:commandButton>
                        </h:panelGroup>

                    </h:panelGrid>
                </p:panel>
            </h:form>
        </div>
    </ui:define>
</ui:composition>